#include "ConcreteFactory.h"
#include<iostream>
static class Product :public AbstractProduct 
{
public:
	 Product(const std::string &type)
	 : AbstractProduct(type)
	 {
	  //NOTHING
	 }
	 Product(const char *type)
	 : AbstractProduct(type)
	 {
	  //NOTHING
	 }
	 ~Product()
	 {
		std::cout << "Product" << type << " destroyed" << std::endl;
	 }
	void operation() override
	{
		std::cout << "Product" << type << " Operation" << std::endl;
	}
};

AbstractProduct * ConcreteFactory::createProduct(const std::string & type)
{
	return new Product(type);
}

AbstractProduct * ConcreteFactory::createProduct(const char * type)
{
	return new Product(type);
}

/*void ConcreteFactory::destroyProduct(AbstractProduct * p)
 {
		delete p;
 }
 */
